package com.itmuch.cloud.comtroller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.itmuch.cloud.FeignClient2;
import com.itmuch.cloud.UsedrFeignClient;
import com.itmuch.cloud.user.User;

@RestController
public class MovieController {
	
	@Autowired
	private UsedrFeignClient usedrFeignClient;
		
	@Autowired
	private FeignClient2 feignClient2;
	
	@GetMapping("/movie/{id}")
	public User findById(@PathVariable("id") Long id) {
		User user = usedrFeignClient.findById(id);
		return user;
	}
	
	@GetMapping("/{serviceName}")
	public String rest(@PathVariable("serviceName") String serviceName) {
		String user = feignClient2.test(serviceName);
		return user;
	}
	
	
}
